# 导包
import jsonschema

# 创建待校验数据
data = {
    "success": True,
    "code": 10000,
    "message": "操作成功",
    "money": 6.66
}
# 创建校验规则
schema = {
    "type": "object",
    "properties": {
        "success": {"const":True},
        "code": {"const":10000},
        "message": {"const":"操作成功"},
        "money": {"const":6.66}
        },
"required":["success","code","message","money"]}
jsonschema.validate(instance=data, schema=schema)
